package com.corpgovernment.organization.operatelog.service.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum BookingRelationEnum {
    T("T","启用"),
    S("S","停用"),
    D("D","删除");
    /**
     * 描述
     */
    private String desc;

    /**
     * cocde
     */
    private String code;


    private BookingRelationEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private static final Map<String, BookingRelationEnum> lookup = new HashMap<>();

    static {
        for (BookingRelationEnum s : EnumSet.allOf(BookingRelationEnum.class)) {
            lookup.put(s.getCode(), s);
        }
    }

    public String getDesc() {
        return desc;
    }

    public String getCode() {
        return code;
    }

    public static BookingRelationEnum get(String code) {
        return lookup.get(code);
    }
}
